package com.jemmyee.pizza.service;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.ICustomAddressDao;
import com.jemmyee.pizza.entity.CustomAddress;

@Repository("customAddressService")
public class CustomAddressServiceImpl implements ICustomAddressService<CustomAddress>{

	private static final Log log = LogFactory.getLog(CustomAddressServiceImpl.class);
	
	@Autowired
	private ICustomAddressDao customAddressDao ;
	
	public void delete(CustomAddress entity) {
		customAddressDao.delete(entity) ;
		
	}

	public void deleteAll(List<CustomAddress> list) {
		customAddressDao.deleteAll(list) ;
		
	}

	public void deleteById(Serializable id) {
		customAddressDao.deleteById(id) ;
		
	}

	public List<CustomAddress> findAll() {
		
		return customAddressDao.findAll(new CustomAddress());
	}

	public List<CustomAddress> findByCriteria(DetachedCriteria criteria) {
		return customAddressDao.findByCriteria(criteria);
	}

	public CustomAddress findById(Serializable id) {
		return customAddressDao.findById(id);
	}

	public List<CustomAddress> findByProperty(String propertyName, Object value) {
		return customAddressDao.findByProperty(new CustomAddress(), propertyName, value);
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex,String order) {
		return customAddressDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public void save(CustomAddress entity) {
		customAddressDao.save(entity) ;
	}

	public void update(CustomAddress entity) {
		customAddressDao.update(entity);
		
	}

}
